package com.cloudlinkscm.loms.services.base.notify.domain.notifier.resolver.response;

import com.cloudlinkscm.loms.services.base.notify.domain.notifier.ResponseResolver;
import com.cloudlinkscm.loms.services.base.notify.model.EmailNotificationResult;
import com.cloudlinkscm.loms.services.base.notify.dto.SendResultDto;
import org.springframework.stereotype.Component;

/**
 * @author : tac
 * @date : 2017/6/15
 */

@Component
public class EmailNotificationResponseResolver implements ResponseResolver<EmailNotificationResult> {
    @Override
    public SendResultDto doResolve(EmailNotificationResult result) {
        SendResultDto dto = new SendResultDto();
        dto.setState(result.getState());
        dto.setMsg(result.getErrorMsg());
        return dto;
    }
}
